<?php
if (COUNT($_POST) > 0)
{
} else 
{
	$id = $this->get('id');
	if ($id)
	{
    	$sql = "SELECT *, id.name as iname FROM item_inventory ii JOIN item_details id USING(iid) WHERE iid=$id";
    	Connection::getConnect();
        Connection::setQuery($sql);
    	$result = Connection::fetch();
	} else {
    	$sql = "SELECT *, id.name as iname FROM item_inventory ii JOIN item_details id USING(iid)";
    	Connection::getConnect();
        Connection::setQuery($sql);
    	$iresult = Connection::fetchAll(MYSQL_ASSOC);
	}
}
?>
